home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 1 / Precision Software Applications Silver Collection Volume One (PSM) (1993).iso / windows / games / 256pbx.exe / ERRORS.C < prev    next >
C/C++ Source or Header  |  1991-12-02  |  3KB  |  65 lines

  1. /*************************************************************************
  2.  
  3.       File:  ERRORS.C
  4.  
  5.    Purpose:  Contains the error message box handler.
  6.  
  7.  Functions:  DIBError()
  8.  
  9.   Comments:  Should use a string table here...We're unnecessarily
  10.              eating up DS, and make it harder to localize for international
  11.              markets...  Maybe next time...
  12.  
  13.    History:   Date     Reason
  14.  
  15.              6/1/91    Created
  16.  
  17. *************************************************************************/
  18.  
  19.  
  20. #include <windows.h>
  21. #include "errors.h"
  22.  
  23.  
  24. static char *szErrors[] = {"Not a DIB file!",
  25.                            "Couldn't allocate memory!",
  26.                            "Error reading file!",
  27.                            "Error locking memory!",
  28.                            "Error opening file!",
  29.                            "Error creating palette!",
  30.                            "Error getting a DC!",
  31.                            "Error creating MDI Child!",
  32.                            "Error creating Device Dependent Bitmap",
  33.                            "StretchBlt() failed!",
  34.                            "StretchDIBits() failed!",
  35.                            "Paint requires both DDB and DIB!",
  36.                            "SetDIBitsToDevice() failed!",
  37.                            "Printer: StartDoc failed!",
  38.                            "Printing: GetModuleHandle() couldn't find GDI!",
  39.                            "Printer: SetAbortProc failed!",
  40.                            "Printer: StartPage failed!",
  41.                            "Printer: NEWFRAME failed!",
  42.                            "Printer: EndPage failed!",
  43.                            "Printer: EndDoc failed!",
  44.                            "Only one DIB can be animated at a time!",
  45.                            "No timers available for animation!",
  46.                            "Can't copy to clipboard -- no current DIB!",
  47.                            "Clipboard is busy -- operation aborted!",
  48.                            "Can't paste -- no DIBs or DDBs in clipboard!",
  49.                            "SetDIBits() failed!",
  50.                            "File Not Found!",
  51.                            "Error writing DIB file!"
  52.                           };
  53.  
  54. void DIBError (int ErrNo)
  55. {
  56.    if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
  57.    {
  58.       MessageBox (GetFocus (), "Undefined Error!", NULL, MB_OK | MB_ICONHAND);
  59.    }
  60.    else
  61.    {
  62.       MessageBox (GetFocus (), szErrors[ErrNo], NULL, MB_OK | MB_ICONHAND);
  63.    }
  64. }
  65.